package net.mcreator.toolsasfood.procedures;

import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.LevelAccessor;
import net.minecraft.world.level.Level;
import net.minecraft.core.BlockPos;

public class BrokeStoneProcedure {
	public static void execute(LevelAccessor world, double x, double y, double z) {
		BlockPos pos = new BlockPos((int) x, (int) y, (int) z);
		for(BlockPos blockpos : BlockPos.betweenClosed(pos.offset(-2,-2,-2),pos.offset(2,2,2))){
			if (Blocks.STONE == (world.getBlockState(blockpos)).getBlock()) {
				if (world instanceof Level) {
					Block.dropResources(world.getBlockState(blockpos), (Level) world,
							blockpos);
					world.destroyBlock(blockpos, false);
				}
			}
		}
	}
}
